//member.js 用于定义用户的登录、注册、注销等
import store from '../stroes';
import req from './http.js';
const http = '/recruit-portal-api/v1/'
const headers_form_urlencoded = { 'content-type': 'application/x-www-form-urlencoded' }
const headers_json = {'content-type':'application/json'}
const headers_formData = {'content-type':'multipart/form-data'}
const homepage = '/recruit-portal-api/v1/homepage/'
const register='/recruit-portal-api/v1/register/'
const company = '/recruit-portal-api/v1/enterprise/'  //企业接口
const common = '/recruit-portal-api/v1/common/'
// const user = '/recruit-portal-api/v1/user/'


export const getDisclaimer = params => req.get(http+'register/getDisclaimer', params) //免责声明
export const getUspap = params => req.get(http+'register/getUspap', params) //用户服务及隐私授权协议
export const getUerAuthorProtocal = params => req.get(http+'register/getUerAuthorProtocal', params) //用户服务及隐私授权协议

//定义接口  
export const homeBanner = params => req.get(homepage+'themeViewpager', params) //主题轮播
export const homeNews = params => req.get(homepage+'articles', params,) //新闻资讯（政策发文+资讯新闻）
export const serviceItems = params => req.post(homepage+'serviceItems', params,{ headers: headers_json }) //服务事项-快捷导航
export const photoStyle = params => req.get(homepage+'photoStyle', params) //照片风采
export const login = params => req.postAdd(register+'login', params,{headers:headers_json}) //登陆接口
export const forgotPassword = params => req.post(register + 'forgotPassword', params, { headers: headers_json }) //登陆接口
export const checkName = params => req.post(http+'register/checkUserNamePhoneNumber', params, { headers: headers_json }) //登陆接口
export const corporateTypeList = params => req.get(http+'dictionary/list', params, { headers: headers_form_urlencoded }) //登陆接口
export const registerBusiness = params => req.post(http+'register/business', params, { headers: headers_json }) //企业注册
export const registerUser = params => req.post(http+'register/user', params, { headers: headers_json }) //个人注册
export const getCode = params => req.get(http+'register/phone', params, { headers: headers_form_urlencoded }) //个人注册

export const queryPolicyGr = params => req.postAdd(http+'talent-policy/getPersonQueryPolicy', params, { headers: headers_json }) //个人中心-政策申报列表
export const queryPolicyGrDetail = params => req.get(http+'talent-policy/getDeclarationApplyUserDetail', params, { headers: headers_form_urlencoded }) //个人中心-政策申报列表-详情
export const queryPolicy = params => req.postAdd(http+'talent-policy/queryEnterprisePolicy', params, { headers: headers_json }) //企业中心-政策申报列表

export const getDeclarationApplyCompanyDetail = params => req.get(http+'talent-policy/getDeclarationApplyCompanyDetail',params, { headers: headers_form_urlencoded }) //企业中心--政策申报详情页面
export const pageApplyStuffEnterprise = params => req.get(http+'talent-policy/getDeclarationApplyCompanyDetailPage', params)//企业中心--政策申报详情页面--人才列表分页
export const queryPolicyCount = params => req.get(http+'talent-policy/getEnterpriseQueryPolicyCount', params)//企业中心-政策申报列表页面统计接口
export const queryPolicyCountGr = params => req.get(http+'talent-policy/getPersonQueryPolicyCount', params)//个人中心-政策申报列表页面统计接口


export const details = params => req.postAdd(company+'details',params)  								//获取企业信息
export const queryJob = params => req.post(company+'queryJob',params,{headers:headers_json})  			//获取职位列表
export const jobDetail = parms => req.get(company+'jobDetail', parms) 									//职位详情
export const jobOperation = parms => req.get(company+'jobOperation', parms) 							//职位操作
export const update = parms => req.post(company+'update',parms,{headers:headers_json})											//账号管理--用户资料

export const qyNature = parms => req.get(http+'dictionary/list',parms) //获取企业性质

export const enterpriseCertLog = parms => req.postAdd(company+'enterpriseCertLog',parms) //认证记录

export const provinceCity = params => req.get(http+'common/cities', params) //获取省市行政区划
export const enterpriseNewJob = params => req.postAdd(http+'enterprise/newJob',params,{headers:headers_json}) //企业发布
export const enterpriseJobDetail = params => req.get(http+'enterprise/jobDetail',params,{headers:headers_formData}) //企业查看职位详情
export const styleList = params => req.get(http+'dictionary/list', params) //类型

export const uploadFile = params => req.postAdd(common+'uploadFile', params,{headers:headers_json}) //上传附件
export const perfectEnterpriseInfo = params => req.postAdd(company+'perfectEnterpriseInfo', params,{headers:headers_json}) //完善企业信息


// zxb新增
export const certificationRequest = params => req.get(company+'certificationRequest',params, {id:store.state.userInfo.id}) //企业中心-认证申请
// export const getCurrentInfo = params => req.get(http+'user/getCurrentInfo',params);//获取当前登陆用户信息
export const getCurrentInfo = params => req.get(http+'user/userInfo',params);//获取当前登陆用户信息
export const getDetail = params => req.get(http+'talent-policy/getDetail', params)//企业政策申报详情
export const getPositonPager = params => req.postAdd(http+'position-employ/getPositonPager', params,{headers:headers_json})//职位搜索
export const getNews = params => req.post(http+'news/getNews?pageNo='+params.pageNo+'&pageSize='+params.pageSize, params)//新闻资讯列表页
export const gongaoList = params => req.post(http+'activity-registration/list', params,{headers:headers_json})//公告列表页
export const gongaoDetails = params => req.post(http+'activity-registration/details?id='+params.id, params)//公告列表详情

export const activityApply = params => req.post(http+'news/activityApply', params,{headers:headers_json})//活动报名
export const getNewsDetail = params => req.post(http+'news/getDetail?id='+params.id, params,{headers:headers_json})//新闻资讯详情
export const cuserInfoUp = params => req.postAdd(http+'enterprise/update', params,{headers:headers_json})//企业账户管理-编辑信息
export const updatePwd = params => req.postAdd(http+'user/updatePwd', params,{headers:headers_json})//修改密码


export const perfectResume = params => req.postAdd(http+'user/perfectResume', params,{headers:headers_json})//完善简历
export const resumeDetail = params => req.get(http+'user/details', params, { headers: headers_form_urlencoded }) //简历详情
export const cooperationList = params => req.postAdd(http+'user/getCooperationOpportunityPageList', params, { headers: headers_json }) //合作申请列表
export const cooperationDetail = params => req.get(http+'user/getCooperationOpportunityDetail', params) //合作申请详情
export const requestSuggest = params => req.postAdd(http+'user/requestSuggest', params, { headers: headers_json }) //交流建议列表
export const suggestDetail = params => req.get(http+'user/suggestDetail', params) //交流建议详情
export const declarationDetail = params => req.get(http+'talent-policy/getDeclarationIssuedUserDetail', params, { headers: headers_form_urlencoded }) //政策申报详情

export const loginOut = params => req.postAdd(http+'user/loginOut', params) //退出登录
export const updateUserInfo = params => req.postAdd(http+'user/updateUserInfo', params,{headers:headers_json})//个人中心-编辑账户资料
export const download = params => req.postAdd(http+'common/download', params,{headers:headers_json})//下载附件
export const notice = params => req.post(http+'homepage/notice', params,{headers:headers_json})//下载附件
export const myApply = params => req.postAdd(http+'user/myApply', params,{headers:headers_json})//下载附件
export const getResume = params => req.postAdd(http + 'enterprise/resume', params,{headers:headers_json}) //企业中心-应聘简历



//新添加
export const getPositonDetail = params => req.get(http + 'position-employ/getPositonDetail', params, { headers: headers_json }) //职位详情
export const hotJob = params => req.get(http + 'position-employ/hotJob', params, { headers: headers_json }) //热门职位
export const collectJob = params => req.post(http + 'position-employ/pagePositionCollect', params, { headers: headers_json }) //收藏职位
export const deliverResume = params => req.postAdd(http + 'position-employ/deliveryPosition', params, { headers: headers_json }) //投递简历
export const jobRecommend = params => req.get(http + 'position-employ/positionPreferred', params, { headers: headers_json }) //职位优选
export const addCollect = params => req.postAdd(http + 'position-employ/collectPosition', params, { headers: headers_json }) //我的收藏
export const cancelCollect = params => req.get(http + 'position-employ/cancelCollection', params, { headers: headers_json }) //取消收藏
export const getEnterpriseDetail = params => req.get(http + 'position-employ/getEnterpriseDetail', params, { headers: headers_json }) //招聘企业详情
export const resumeManage = params => req.get(http + 'enterprise/resumeManage', params, { headers: headers_json }) //企业中心-应聘简历-简历操作
export const getResumeDetail = params => req.get(http + 'enterprise/resumeDetail', params, { headers: headers_json }) //企业中心-应聘简历-简历操作
export const mainCooperationDetail = params => req.get(http + 'projectCooperation/cooperationDetail', params) //企业中心-应聘简历-简历操作

export const policyDecode = params => req.post(http + 'talent-policy/listPolicyUnderstanding', params, { headers: headers_json }) //人才政策 政策解读
export const policySending = params => req.post(http + 'talent-policy/listPolicyArticle', params, { headers: headers_json }) //人才政策 政策发文
export const policyDeclare = params => req.post(http + 'talent-policy/listPolicyIssued', params, { headers: headers_json }) //人才政策 政策申报
export const policyCash = params => req.post(http + 'talent-policy/getDeclarationCashInPager', params, { headers: headers_json }) //人才政策--兑换
export const policyRecommend = params => req.get(http + 'talent-policy/getEnterpriseDetail', params, { headers: headers_json }) //人才政策 政策兑现
export const getDeclarationCashInDetail = params => req.post(http + 'talent-policy/getDeclarationCashInDetail?declarationIssuedId='+params.declarationIssuedId, params) //人才政策 政策兑现-详情
export const getStuffPage = params => req.post(http + 'talent-policy/getStuffPage', params) //政策兑现-详情页-申报用户列表页


export const policyDecodeMore = params => req.post(http + 'talent-policy/pagePolicyUnderstanding', params, { headers: headers_json }) //人才政策 政策解读
export const policySendingMore = params => req.post(http + 'talent-policy/pagePolicyArticle', params, { headers: headers_json }) //人才政策 政策发文
export const policyDeclareMore = params => req.post(http + 'talent-policy/pagePolicyIssued', params, { headers: headers_json }) //人才政策 政策申报
export const policyCashMore = params => req.post(http + 'talent-policy/getPolicyCash', params, { headers: headers_json }) //人才政策 政策推荐
export const policyRecommendMore = params => req.get(http + 'talent-policy/getEnterpriseDetail', params, { headers: headers_json }) //人才政策 政策兑现
export const getPhoto = params => req.get(http + 'talent-policy/getPhoto', params, { headers: headers_json }) //风采照片


export const getDeclarationIssuedCompanyDetail = params => req.get(http + 'talent-policy/getDeclarationIssuedCompanyDetail', params) //政策申报详情-企业
export const getDeclarationIssuedUserDetail = params => req.get(http + 'talent-policy/getDeclarationIssuedUserDetail', params) //政策申报详情-个人
export const getUserApplyMaterialList = params => req.get(http + 'talent-policy/getUserApplyMaterialList', params) //政策申报详情-企业添加人员个人申报材料列表

export const saveDeclarationIssuedUserDetail = params => req.postAdd(http + 'talent-policy/saveDeclarationIssuedUserDetail', params, { headers: headers_json }) //政策申报提交、暂存（个人）
export const saveDeclarationIssuedCompanyDetail = params => req.postAdd(http + 'talent-policy/saveDeclarationIssuedCompanyDetail', params, { headers: headers_json }) //政策申报提交、暂存（企业）


export const policyDecodeDetail = params => req.get(http + 'talent-policy/understandingDetail', params) //人才政策 政策解读详情
export const policySendingDetail = params => req.get(http + 'talent-policy/getPolicyArticle', params, { headers: headers_json }) //人才政策 政策发文详情




//项目合作
//院校合作/企业合作	cooperationCategary	合作类别:1院校合作,2企业合作	
export const proCooperationUnit = params => req.post(http + 'projectCooperation/cooperationUnit', params, { headers: headers_json })
//项目合作-入住企业墙
export const proEnterpriseWall = params => req.post(http + 'projectCooperation/enterpriseWall', params, { headers: headers_json })
//项目合作-合作留言
export const proCooperationMsg = params => req.postAdd(http + 'projectCooperation/message', params, { headers: headers_json })



//zml 新增
export const training = params => req.postAdd(http+'talent/training', params, { headers: headers_json }) //名师讲堂列表
export const trainingDetails = params => req.get(http+'talent/trainingDetails',params, { headers: headers_form_urlencoded }) //名师讲堂详情
export const talentApply = params => req.postAdd(http+'talent/apply', params, { headers: headers_json }) //名师讲堂报名
export const operationWarn = params => req.get(http+'talent/operationWarn',params, { headers: headers_form_urlencoded }) //名师讲堂操作提醒
export const newRequestSuggest = params => req.postAdd(http+'talent/newRequestSuggest',params,{ headers: headers_json }) //需求建议提交
export const elite = params => req.post(http+'news/getNews?belongType=4&pageNo='+params.pageNo+'&pageSize='+params.pageSize,params, { headers: headers_form_urlencoded }) //行业精英荟

export const getNationAndHujiJson = params => req.get(http+'enterprise/getNationAndHujiJson',params) //国籍/户籍
export const getProvinceCityJson = params => req.get(http+'enterprise/getProvinceCityJson',params) //居住地





export const activityApplyNew = params => req.post(http+'activity-registration/apply',params, { headers: headers_json }) //行业精英荟


export const getResumeJudge = params => req.get(http+'position-employ/resumeJudge',params, { headers: headers_json }) //行业精英荟

export const getServiceItemDetail = params => req.post(http+'talent/getServiceItemDetail?id='+params.id,params, { headers: headers_json }) //行业精英荟
export const getJianLi = 'http://118.24.31.25:8889'+http+'common/outputResume' //导出简历



export const getEnterpriseWallDetails = params => req.post(http+'enterprise/getEnterpriseWallDetails?enterpriseId='+params.enterpriseId,params) //企业墙-获取企业信息

export const policyMatchPost = params => req.post(http+'talent-policy/policyMatch',params, { headers: headers_json }) //政策匹配




